#!/bin/sh

SRC_DIR=$(cd "$(dirname "$0")";pwd)
cd $SRC_DIR

LIBPCAP_DIR=`ls | grep 'libpcap'`
cd $LIBPCAP_DIR; chmod +x configure; ./configure && make libpcap.a; cd -

LIBS=`grep "LIBS" $LIBPCAP_DIR/Makefile | awk -F'=' '{print $2}'`
g++ -o ur ur.cpp -I$LIBPCAP_DIR/pcap $LIBPCAP_DIR/libpcap.a $LIBS
